package aiku.numericalcontroloa.Controller.AfterController;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Model.Dto.AfterSalesDto;
import aiku.numericalcontroloa.Model.Entity.AfterSales;
import aiku.numericalcontroloa.Service.Impl.AfterSalesServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 马文杰
 * @version 1.0
 */
@RestController
@RequestMapping("/afterSales")
public class AfterSalesController {
    @Autowired
    private AfterSalesServiceImpl afterSalesService;
    /**
     * 查询当前售后人员的派单记录,分页
     */
    @PostMapping("afterDispatch")
    public Result afterDispatch(@RequestParam("page") Integer page,@RequestParam("size") Integer size){
        return afterSalesService.afterDispatch(page,size);
    }

    /**
     * 修改保存安装时间和培训内容
     */
    @PostMapping("updateInstall")
    public Result afterSales(@RequestBody AfterSales afterSales){
        return afterSalesService.afterSales(afterSales);
    }

    /**
     * 获取售后列表
     * @param afterSalesDto
     * @return
     */
    @PostMapping("/getAfterSaleList")
    public Result getAfterSaleList(@RequestBody AfterSalesDto afterSalesDto){
        return afterSalesService.getAfterSaleList(afterSalesDto);
    }
}
